﻿<UserControl x:Class="TradeMo.CriteriaPropertyForSaleView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" 
    mc:Ignorable="d"
    d:DataContext="{d:DesignData SampleData/CriteriaPropertyForSaleSampleData.xaml}"
             
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignWidth="480">

    <Grid x:Name="LayoutRoot">
        <VisualStateManager.CustomVisualStateManager>
            <ic:ExtendedVisualStateManager/>
        </VisualStateManager.CustomVisualStateManager>
        <Grid.Projection>
            <PlaneProjection CenterOfRotationY="0"/>
        </Grid.Projection>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualStateGroup.Transitions>
                    <VisualTransition GeneratedDuration="0:0:0.3">
                        <VisualTransition.GeneratedEasingFunction>
                            <CubicEase EasingMode="EaseIn"/>
                        </VisualTransition.GeneratedEasingFunction>
                    </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="VisibleState"/>
                <VisualState x:Name="HiddenState">
                    <Storyboard>
                        <DoubleAnimation Duration="0" To="-90" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="LayoutRoot" d:IsOptimized="True"/>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Border BorderThickness="3" Width="480" HorizontalAlignment="Center" Background="{StaticResource PhoneChromeBrush}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock HorizontalAlignment="Center" Text="Property For Sale Search Criteria" />
                <StackPanel Grid.Row="1" >
                    <Grid x:Name="RegionGrid" MouseLeftButtonUp="RegionGrid_MouseLeftButtonUp">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="REGION" Style="{StaticResource PhoneTextSmallStyle}" FontSize="13.333"/>
                        <TextBlock Grid.Row="1" Text="{Binding RegionName}" Margin="12,0,0,0"/>
                        <Image Grid.RowSpan="2" Source="icons/appbar.next.rest.png" Grid.Column="1" Stretch="None"/>
                    </Grid>
                    <Grid x:Name="DistrictGrid" MouseLeftButtonUp="DistrictGrid_MouseLeftButtonUp" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="DISTRICT" Style="{StaticResource PhoneTextSmallStyle}" FontSize="13.333"/>
                        <TextBlock Grid.Row="1" Text="{Binding DistrictName}" Margin="12,0,0,0" />
                        <Image Grid.RowSpan="2" Source="icons/appbar.next.rest.png" Grid.Column="1" Stretch="None"/>
                        <Border Background="Black" Opacity="0.3" 
                                Grid.RowSpan="2" Grid.ColumnSpan="2" 
                                Visibility="{Binding DistrictVisible, ConverterParameter=Collapsed, Converter={StaticResource VisibilityConverter}, Mode=OneWay}"/>
                    </Grid>
                    <Grid x:Name="SuburbGrid" MouseLeftButtonUp="SuburbGrid_MouseLeftButtonUp" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="SUBURB" Style="{StaticResource PhoneTextSmallStyle}" FontSize="13.333"/>
                        <TextBlock Grid.Row="1" Text="{Binding SuburbName}" Margin="12,0,0,0" />
                        <Image Grid.RowSpan="2" Source="icons/appbar.next.rest.png" Grid.Column="1" Stretch="None"/>
                        <Border Background="Black" Opacity="0.3" 
                                Grid.RowSpan="2" Grid.ColumnSpan="2" 
                                Visibility="{Binding SuburbVisible, ConverterParameter=Collapsed, Converter={StaticResource VisibilityConverter}, Mode=OneWay}"/>
                    </Grid>

                    <Grid x:Name="SearchNearbyGrid">
                        <CheckBox IsChecked="{Binding Criteria.AdjacentSuburbs, Mode=TwoWay}">
                            <TextBlock Text="Search nearby suburbs" Style="{StaticResource PhoneTextNormalStyle}"/>
                        </CheckBox>
                        <Border Background="Black" Opacity="0.3" 
								Visibility="{Binding SearchNearbyVisible, ConverterParameter=Collapsed, Converter={StaticResource VisibilityConverter}, Mode=OneWay}"/>
                    </Grid>

                    <Grid x:Name="PropertyTypeGrid" MouseLeftButtonUp="PropertyTypeGrid_MouseLeftButtonUp">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="PROPERTY TYPE" Style="{StaticResource PhoneTextSmallStyle}" FontSize="13.333"/>
                        <TextBlock Grid.Row="1" Text="{Binding PropertyTypeName}" Margin="12,0,0,0"/>
                        <Image Grid.RowSpan="2" Source="icons/appbar.next.rest.png" Grid.Column="1" Stretch="None"/>
                    </Grid>

                    <Grid x:Name="BedroomsGrid">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="BEDROOMS" Style="{StaticResource PhoneTextSmallStyle}" FontSize="13.333"/>
                        <TextBlock Grid.Row="1" Text="{Binding BedroomsFromName}" Margin="12,0,0,0" MouseLeftButtonUp="BedroomsFrom_MouseLeftButtonUp"/>
                        <Image Grid.RowSpan="2" Source="icons/appbar.next.rest.png" Grid.Column="1" Stretch="None" MouseLeftButtonUp="BedroomsFrom_MouseLeftButtonUp"/>
                        <TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding BedroomsToName}" Margin="12,0,0,0" MouseLeftButtonUp="BedroomsTo_MouseLeftButtonUp" />
                        <Image Grid.RowSpan="2" Source="icons/appbar.next.rest.png" Grid.Column="3" Stretch="None" MouseLeftButtonUp="BedroomsTo_MouseLeftButtonUp"/>
                    </Grid>

                    <Grid x:Name="BathroomsGrid">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="BATHROOMS" Style="{StaticResource PhoneTextSmallStyle}" FontSize="13.333"/>
                        <TextBlock Grid.Row="1" Text="{Binding BathroomsFromName}" Margin="12,0,0,0" MouseLeftButtonUp="BathroomsFrom_MouseLeftButtonUp"/>
                        <Image Grid.RowSpan="2" Source="icons/appbar.next.rest.png" Grid.Column="1" Stretch="None" MouseLeftButtonUp="BathroomsFrom_MouseLeftButtonUp"/>
                        <TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding BathroomsToName}" Margin="12,0,0,0" MouseLeftButtonUp="BathroomsTo_MouseLeftButtonUp" />
                        <Image Grid.RowSpan="2" Source="icons/appbar.next.rest.png" Grid.Column="3" Stretch="None" MouseLeftButtonUp="BathroomsTo_MouseLeftButtonUp"/>
                    </Grid>

                    <Grid x:Name="PriceGrid">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="PRICE" Style="{StaticResource PhoneTextSmallStyle}" FontSize="13.333"/>
                        <TextBlock Grid.Row="1" Text="{Binding PriceFromName}" Margin="12,0,0,0" MouseLeftButtonUp="PriceFrom_MouseLeftButtonUp"/>
                        <Image Grid.RowSpan="2" Source="icons/appbar.next.rest.png" Grid.Column="1" Stretch="None" MouseLeftButtonUp="PriceFrom_MouseLeftButtonUp"/>
                        <TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding PriceToName}" Margin="12,0,0,0" MouseLeftButtonUp="PriceTo_MouseLeftButtonUp" />
                        <Image Grid.RowSpan="2" Source="icons/appbar.next.rest.png" Grid.Column="3" Stretch="None" MouseLeftButtonUp="PriceTo_MouseLeftButtonUp"/>
                    </Grid>

                    <Grid x:Name="SortByGrid" MouseLeftButtonUp="SortByGrid_MouseLeftButtonUp">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="SORT BY" Style="{StaticResource PhoneTextSmallStyle}" FontSize="13.333"/>
                        <TextBlock Grid.Row="1" Text="{Binding SortByName}" Margin="12,0,0,0"/>
                        <Image Grid.RowSpan="2" Source="icons/appbar.next.rest.png" Grid.Column="1" Stretch="None"/>
                    </Grid>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Center" >
                    <Button x:Name="ResetButton" Content="reset" Width="200" Click="ResetButton_Click" />
                    <Button x:Name="RefreshButton" Content="Search" Width="200" Click="RefreshButton_Click"  />
                </StackPanel>
            </Grid>
        </Border>

    </Grid>
</UserControl>
